package com.wenlong.agricultural.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wenlong.agricultural.mapper.ShoppingCartMapper;
import com.wenlong.agricultural.pojo.ShoppingCartInfo;
import com.wenlong.agricultural.service.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 苏文龙
 * @version 1.0
 */
@Service
public class ShoppingCartServiceImpl extends ServiceImpl< ShoppingCartMapper, ShoppingCartInfo> implements ShoppingCartService {
    @Autowired
    private ShoppingCartMapper shoppingCartMapper;
    @Override
    public List<ShoppingCartInfo> getCartsByUserId(Long uid) {
        QueryWrapper<ShoppingCartInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("uid", uid);
        return shoppingCartMapper.selectList(queryWrapper);
    }
}
